<?php
/**
 *
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */

$cakeDescription = __d('cake_dev', 'Pokerface');
$cakeVersion = __d('cake_dev', 'CakePHP %s', Configure::version())
?>
<!DOCTYPE html>
<html>
	<head>
		<?php echo $this->Html->charset(); ?>
		<title>
			<?php echo $cakeDescription ?>:
			<?php echo $title_for_layout; ?>
		</title>
		<?php
			echo $this->Html->meta('icon');

			//echo $this->Html->css('cake.generic');
			echo $this->Html->css('bootstrap');
			echo $this->Html->css('bootstrap-theme');

			echo $this->Html->script('jquery.min');
			echo $this->Html->script('bootstrap');
			
			echo $this->fetch('meta');
			echo $this->fetch('css');
			echo $this->fetch('script');
			
			setcookie("username", $this->Session->read('Auth.User.username'), false, "/", false)
		?>
		
		<!-- Meta Tags -->
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

		<title>Poker &amp; People - Flensburg </title>
		<meta name="description" content="Insert Your Site Description" /> 

		<!-- Mobile Specifics -->
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="HandheldFriendly" content="true"/>
		<meta name="MobileOptimized" content="320"/>   

		<!-- Mobile Internet Explorer ClearType Technology -->
		<!--[if IEMobile]>  <meta http-equiv="cleartype" content="on">  <![endif]-->

		<!-- Main Style -->
		<link href="/css/main.css" rel="stylesheet">

		<!-- Supersized -->
		<link href="/css/supersized.css" rel="stylesheet">
		<link href="/css/supersized.shutter.css" rel="stylesheet">

		<!-- FancyBox -->
		<link href="/css/fancybox/jquery.fancybox.css" rel="stylesheet">

		<!-- Font Icons -->
		<link href="/css/fonts.css" rel="stylesheet">

		<!-- Shortcodes -->
		<link href="/css/shortcodes.css" rel="stylesheet">

		<!-- Responsive -->
		<link href="/css/bootstrap-responsive.min.css" rel="stylesheet">
		<link href="/css/responsive.css" rel="stylesheet">

		<!-- Supersized -->
		<link href="/css/supersized.css" rel="stylesheet">
		<link href="/css/supersized.shutter.css" rel="stylesheet">

		<!-- pokerface -->
		<link href="/css/purlybutton.css" rel="stylesheet">
		<link href="/css/pokerface.css" rel="stylesheet">


		<!-- Fav Icon -->
		<link rel="shortcut icon" href="#">

		<link rel="apple-touch-icon" href="#">
		<link rel="apple-touch-icon" sizes="114x114" href="#">
		<link rel="apple-touch-icon" sizes="72x72" href="#">
		<link rel="apple-touch-icon" sizes="144x144" href="#">

	</head>
	<body style="font-family: arial">
		<!-- This section is for Splash Screen -->
		<div class="ole">
		<section id="jSplash">
			<div id="circle"></div>
		</section>
		</div>
		<!-- End of Splash Screen -->

		<!-- Homepage Slider -->
		<div id="home-slider">
		
		<!-- CAKEPHP HEADBAR -->
			<nav class="navbar navbar-default navbar-static-top sticky-nav" role="navigation" style="opacity:0.6;">
				<div class="container-fluid">
					<div class="navbar-header">
						<?PHP echo $this->Html->link($cakeDescription, array('controller' => 'pages', 'action' => 'home'), array('class' => 'navbar-brand')); ?>
					</div>
					<ul class="nav navbar-nav navbar-right">
						<li>
							<?PHP
								if ($this->Session->read('Auth.User.rangID') >= 2){
									echo $this->Html->link('News erstellen', array('controller' => 'news', 'action' => 'add'));
								}
							?>
						</li>
					</ul>
				</div>
				<div class="container-fluid navbar-static-">
					<ul class="nav nav-pills">
						<?PHP
						/* link News */
						echo $this->Html->tag('li', $this->Html->link('News', array('controller' => 'news', 'action' => 'show')) , null);
						/* link Mitglieder */
						echo $this->Html->tag('li', $this->Html->link('Mitglieder', array('controller' => 'users', 'action' => 'show')) , null);
						/* link Regeln */
						echo $this->Html->tag('li', $this->Html->link('Regeln', array('controller' => 'pages', 'action' => 'rules')) , null);
						/* link Impressum */
						echo $this->Html->tag('li', $this->Html->link('Impressum', array('controller' => 'pages', 'action' => 'impressum')), null);
						/* link Über uns */
						echo $this->Html->tag('li', $this->Html->link('Über uns', array('controller' => 'pages', 'action' => 'aboutus')), null);
						/* link Kontakt */
						echo $this->Html->tag('li', $this->Html->link('Kontakt', array('controller' => 'contacts', 'action' => 'index')), null);
					?>
						
						<div id="userAction" class="nav navbar-nav navbar-right">
							<?PHP
								if ($this->Session->read('Auth.User')){ ?>
								<li>
									<?PHP
										echo $this->Html->link('Profil', array('controller' => 'pages', 'action' => 'game'), null);
									?>
								</li>
								<li>
									<?PHP
										echo $this->Html->link('Profil', array('controller' => 'users', 'action' => 'profil', $this->Session->read('Auth.User.id')), null);
									?>
								</li>
								<li>
									<?PHP
										echo $this->Html->link('Freundesliste', array('controller' => 'friends', 'action' => 'show', $this->Session->read('Auth.User.id')), null);
									?>
								</li>
								<li>
									<?PHP
										echo $this->Html->link('Nachrichten', array('controller' => 'messages', 'action' => 'show'));
									?>
								</li>
								<li>
									<?PHP
										echo $this->Html->link('Passwort ändern', array('controller' => 'users', 'action' => 'changepw'));
									?>
								</li>
								<li>
									<?PHP
										echo $this->Html->link('Ausloggen', array('controller' => 'users', 'action' => 'logout'));
									?>
								</li>
							<?PHP
								}else{
									echo $this->Html->tag('li', $this->Html->link('Einloggen', array('controller' => 'users', 'action' => 'login')) , null);
									echo $this->Html->tag('li', $this->Html->link('Registrieren', array('controller' => 'users', 'action' => 'add')), null);
								} 
							?>
						</div>
					</ul>
				</div>
			</nav>
			
			<!-- END CAKEPHP HEADBAR -->
			<div id="content" class="auto">
				<?php echo $this->Session->flash(); ?>
				<?php echo $this->fetch('content'); ?>
			</div>
			
			<div class="control-nav">
				<a id="prevslide" class="load-item"><i class="font-icon-arrow-simple-left"></i></a>
				<a id="nextslide" class="load-item"><i class="font-icon-arrow-simple-right"></i></a>
				<ul id="slide-list"></ul>
				<div id="chatAction">
					<input id="chatText" type="text" placeholder="schreibe etwas..." />
					<input id="sendMsg" type="submit" class="btn" value="senden" />
				</div>
			</div>
			<div id="calendar"></div>
			<div id="chatWrapper">
				<div id="chat">
					<div id="chatContent"></div>
				</div>
			</div>
		</div>
		<!-- End Homepage Slider -->		
	</body>
	
	<!-- Js -->
	<script src="/js/modernizr.js"></script>
	<script src="/js/bootstrap.min.js"></script> <!-- Bootstrap -->
	<script src="/js/supersized.3.2.7.min.js"></script> <!-- Slider -->
	<script src="/js/waypoints.js"></script> <!-- WayPoints -->
	<script src="/js/waypoints-sticky.js"></script> <!-- Waypoints for Header -->
	<script src="/js/jquery.isotope.js"></script> <!-- Isotope Filter -->
	<script src="/js/jquery.tweet.js"></script> <!-- Tweet -->
	<script src="/js/plugins.js"></script> <!-- Contains: jPreloader, jQuery Easing, jQuery ScrollTo, jQuery One Page Navi -->
	<script src="/js/main.js"></script> <!-- Default JS -->
	<script src="/js/jquery-ui.custom.min.js"></script> <!-- fullcalendar -->
	<script src="/js/socket.io.js"></script> <!-- chatClient NodeJS JS -->
	<script src="/js/chatClient.js"></script> <!-- chatClient NodeJS JS -->
	<!-- End Js -->
</html>
